package ar.edu.unq.persistencia.Rate_me_java;

import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.criterion.Restrictions;



public class DAO {
	
	public static List<User> getJugadores() {
        Session session = SessionManager.getSession();
        Criteria q = session.createCriteria(User.class);
        List<User> l = q.list();
        return l;
    }
	
	public static User getUserForName(String name) {
        Session session = SessionManager.getSession();
        Criteria q = session.createCriteria(User.class);
        q.add(Restrictions.eq("nombre", name));
        List<User> l = q.list();
        return l.get(0);
    }

}
